Deriving a Relationship from a Single Example

نویسنده

  • Neil Mitchell
چکیده

Given an appropriate domain specific language (DSL), it is possible to describe the relationship between Haskell data types and many generic functions, typically type-class instances. While describing the relationship is possible, it is not always an easy task. There is an alternative – simply give one example output for a carefully chosen input, and have the relationship derived. When deriving a relationship from only one example, it is important that the derived relationship is the intended one. We identify general restrictions on the DSL, and on the provided example, to ensure a level of predictability. We then apply these restrictions in practice, to derive the relationship between Haskell data types and generic functions. We have used our scheme in the DERIVE tool, where over 60% of type classes are derived from a single example.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Deriving Generic Functions by Example

A function is said to be generic if it operates over values of any data type. For example, a generic equality function can test pairs of booleans, integers, lists, trees etc. In most languages programmers must define generic functions multiple times, specialised for each data type. Alternatively, a tool could be used to specify the relationship between the data type and the implementation, but ...

متن کامل

Quantum Theory and Probability Theory: Their Relationship and Origin in Symmetry

Quantum theory is a probabilistic calculus that enables the calculation of the probabilities of the possible outcomes of a measurement performed on a physical system. But what is the relationship between this probabilistic calculus and probability theory itself? Is quantum theory compatible with probability theory? If so, does it extend or generalize probability theory? In this paper, we answer...

متن کامل

DERIVING THE EQUATION OF STATE FOR LIQUIDS AND EXTENSION OF THE PRINCIPLE OF CORRESPONDING STATES

A new simple model is introduced for a liquid and an equation of state is derived based on this model and the statistical mechanical calculations. This equation of state works well for the non-polar and slightly polar liquids. The important conclusion that may be deduced from this equation of state is that if the reduced variables of state are chosen and defined appropriately, then, the pri...

متن کامل

A single-vendor and a single-buyer integrated inventory model with ordering cost reduction dependent on lead time

Lead time is one of the major limits that affect planning at every stage of the supply chain system. In this paper, we study a continuous review inventory model. This paper investigates the ordering cost reductions are dependent on lead time. This study addressed two-echelon supply chain problem consisting of a single vendor and a single buyer. The main contribution of this study is that the in...

متن کامل

A Simplified Modal Pushover Analysis-based Method for Incremental Dynamic Analysis of Regular RC Moment-resisting Frames

Incremental Dynamic Analysis (IDA) procedure is now considered as a robust tool for estimating the seismic sidesway collapse capacity of structures. However, the procedure is time-consuming and requires numerous nonlinear response-history analyses. This paper proposes a simplified Modal Pushover Analysis (MPA) procedure for IDA of RC moment-resisting frames. The proposed method uses the dynamic...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2009